'''循环五次'''
# i = 0
# while i < 5:
#     print('媳妇，我错了。。。')
#     i = i+1

'''无限循环---if break终止循环'''
'''案例  石头剪刀布'''
# while True:
#     import random
#
#     player = int(input('请出拳：石头1/剪刀2/布3/退出0'))
#     if player == 0:
#         print('欢迎下次游戏')
#         break
#     computer = random.randint(1, 3)
#     if (computer == 1 and player == 3) or (computer == 2 and player == 1) or (computer == 3 and player == 2):
#         print(f'电脑出{computer}, 玩家出{player} 恭喜玩家胜利！')
#     elif computer == player:
#         print(f'电脑出{computer}, 玩家出{player} 平局')
#     else:
#         print(f'电脑出{computer}, 玩家出{player} 玩家输了')

'''求1-100之间的累加'''
# i = 1
# while i < 101:
#     a = i + 1
#     num = a + i
#     i = i + 1
# print(f'{num}')
'''标准'''
# i = 1
# num = 0
# while i <= 100:
#     num = num + i
#     i += 1
#     # i = i+1
# print('求和的结果为：', num)
'''for循环'''
num = 0
for i in range(101):
    num += i
print('求和的结果为：', num)
